﻿@{
    Layout = null;
    TraumaCenterSystem.TraumaCenterManage.PatientInfo P = ViewData["Patient"] as TraumaCenterSystem.TraumaCenterManage.PatientInfo;
}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link rel="stylesheet" href="~/Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" />
    <link rel="stylesheet" href="~/Scripts/ligerUI/skins/ligerui-icons.css" />
    <link rel="stylesheet" href="~/Scripts/ligerUI/skins/Gray/css/all.css" />
    <link rel="stylesheet" href="~/Content/css/common.css" />
    <script src="~/Scripts/jquery-1.10.2.min.js"></script>
    <script src="~/Scripts/ligerUI/js/ligerui.all.js"></script>
    <script src="~/Scripts/common.js"></script>
    <script type="text/javascript">
        var manager;
        $(function () {
            GetPatients();
        });
        function GetPatients() {
            $.ajax({
                url: "/TraumaCenter/FirstAid/GetPatientList",
                cache: false,
                success: function (data) {
                    var d = $.parseJSON(data);
                    if (d.Result == 1) {
                        var jsonData = $.parseJSON(d.Body);
                        $("#selPatientList").html('');
                        for (var i = 0; i < jsonData.length; i++) {
                            var check = "";
                            if (i == 0) { }
                            $("#selPatientList").append("<option value=" + jsonData[i].PATIENT_ID + ">" + jsonData[i].PATIENT_NAME + "&nbsp;&nbsp;&nbsp;" + (jsonData[i].PATIENT_SEX == 1 ? "男" : jsonData[i].PATIENT_SEX == 0 ? "女" : jsonData[i].PATIENT_SEX) + "&nbsp;&nbsp;&nbsp;" + (IsEmpty(jsonData[i].PATIENT_AGE) ? "" : jsonData[i].PATIENT_AGE + "岁") + "</option>");
                        }
                        initTable();
                    }
                },
                error: function () {
                    $.ligerDialog.error("程序错误");
                }
            });
        }
        //加载列表
        function initTable() {
            $("#maingrid").ligerGrid({
                url: '/TraumaCenter/PathwayExe/Search?PatientID=' + $("#selPatientList").val() + '&ram=' + Math.random(),
                columns: [
                    { display: '质控项', name: 'Title', align: 'left', width: 220 },
                    { display: '对比项', name: 'ComparePointTitle', align: 'left', width: 220 },
                    {
                        display: '执行时间', name: 'Time', align: 'left', width: 220,
                        render: function (rowData) {
                            return obj2Timemm(rowData.Time);
                        }
                    },
                    //{ display: '时限', name: 'Sort', minWidth: 20, editor: { type: "string" } },
                    {
                        display: '时限提醒', name: 'OverTimeBool', minWidth: 20, render: function (rowdata, rowindex, value) {
                            var html = "";
                            if (value == true) {
                                html += "<font style='color:red';>已超时</font>";
                            }
                            else {
                                if (rowdata.ComparePointTime != null && rowdata.ComparePointTime != undefined) {
                                    var time1 = "2018-12-14 17:15:00";//rowdata.ComparePointTime;
                                    var now = new Date();
                                    var time2 = new Date();
                                    time2 = time2.Format("yyyy-MM-dd HH:mm:ss");
                                    //var diff = time2.diff(time1);
                                    //alert(time2);
                                    //alert(diff);
                                }
                                //if (rowdata.OverTime - diff<=5) {
                                //    html += "<font style='color:red';>即将超时</font>";
                                //}
                                html += "";
                            }
                            return html;
                        }
                    },
                    //{ display: '漏项提醒', name: 'Time', align: 'left', width: 220, editor: { type: "number" } }
                ],
                enabledEdit: true,
                usePager: false,
                rownumbers: true,
                height: '100%',
                heightDiff: 25
            });
        }
    </script>
</head>
<body>
    <div class="searchbar">
    </div>
    <div class="topPosition">
        <input type="hidden" id="pidd" value="@ViewBag.patientId" />
        <div style="float:left;font-size:13px;">
            <div style="float:left; margin-left:20px;">
                患者：
                <select style="width:150px;" id="selPatientList" onchange="initTable();"></select>
            </div>
            <div style="float:left; margin-left:20px;">
                初步诊断：<label id="Disease">硬膜外血肿</label>
            </div>
        </div>
        <div style="float:right;margin-right:10px;"> </div>
    </div>
    <div id="maingrid"></div>
</body>
</html>